package com.example.mytest6.hj_mitor;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;

import com.example.mytest6.R;

public class MitorActivity extends AppCompatActivity implements View.OnClickListener {

    private TextView tv_temp;
    private RelativeLayout rl_temp;
    private TextView tv_hum;
    private RelativeLayout rl_hum;
    private TextView tv_light;
    private RelativeLayout rl_light;
    private TextView tv_CO2;
    private RelativeLayout rl_co2;
    private TextView tv_pm2;
    private RelativeLayout rl_pm2;
    private TextView tv_road;
    private RelativeLayout rl_road;
    private TextView tv_yuzhi;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_mitor);
        initView();
    }

    private void initView() {
        tv_temp = (TextView) findViewById(R.id.tv_temp);
        rl_temp = (RelativeLayout) findViewById(R.id.rl_temp);
        tv_hum = (TextView) findViewById(R.id.tv_hum);
        rl_hum = (RelativeLayout) findViewById(R.id.rl_hum);
        tv_light = (TextView) findViewById(R.id.tv_light);
        rl_light = (RelativeLayout) findViewById(R.id.rl_light);
        tv_CO2 = (TextView) findViewById(R.id.tv_CO2);
        rl_co2 = (RelativeLayout) findViewById(R.id.rl_co2);
        tv_pm2 = (TextView) findViewById(R.id.tv_pm2);
        rl_pm2 = (RelativeLayout) findViewById(R.id.rl_pm2);
        tv_road = (TextView) findViewById(R.id.tv_road);
        rl_road = (RelativeLayout) findViewById(R.id.rl_road);
        tv_yuzhi = (TextView) findViewById(R.id.tv_yuzhi);
        tv_yuzhi.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.tv_yuzhi:
                startActivity(new Intent(this, SetYuZhiActivity.class));
                break;
        }

    }
}
